import { Column, Entity, PrimaryGeneratedColumn, Unique } from 'typeorm';

@Entity('user')
export class User {
  @PrimaryGeneratedColumn()
  id: number;

  @Column()
  @Unique(['email'])
  email: string;

  @Column()
  password: string;

  @Column({ name: 'header_img' })
  headerImg: string;

  @Column()
  name: string;

  @Column()
  nickname: string;

  @Column()
  sex: number;

  @Column()
  age: number;

  @Column({ name: 'last_login' })
  lastLogin: Date;

  @Column({ name: 'create_time' })
  createdTime: Date;

  @Column({ name: 'update_time' })
  updatedTime: Date;
}
